package day1;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Scanner;

public class TestDemo {
    public static void fun() {
        HashSet<Character> set = new HashSet<>();
        StringBuilder stringBuilder = new StringBuilder();
        Scanner scanner = new Scanner(System.in);
        String s1 = scanner.nextLine();
        String s2 = scanner.nextLine();
        for (int i = 0; i < s2.length(); i++) {
            set.add(s2.charAt(i));
        }
        for (int i = 0; i < s1.length(); i++) {
            if(set.contains(s1.charAt(i))){
                continue;
            }else {
                stringBuilder.append(s1.charAt(i));
            }
        }
        System.out.println(stringBuilder.toString());
    }
    public static void main(String[] args) {
        fun();
    }
}
